package com.shopping.miaosha.response;

/**
 * @author canger
 * @Deseription 返回类型
 * @create 2019/3/25 15:50
 **/
public class ResultType {

    private String status;

    private Object data;

    //定义一个通用的创建方法 默认status为success
    public static ResultType getResult(Object result){
        return ResultType.getResult(result,"success");
    }

    public static ResultType getResult(Object result,String status){
        ResultType resultType = new ResultType();
        resultType.setStatus(status);
        resultType.setData(result);
        return resultType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
